package com.kevin.service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kevin.service.entity.SysOrg;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 机构管理(SysOrg)表数据库访问层
 *
 * @author makejava
 * @since 2023-03-27 14:55:23
 */
public interface SysOrgMapper extends BaseMapper<SysOrg> {

    @Select("select t1.*, (select t2.name from sys_org t2 where t2.id = t1.pid) parentName from sys_org t1 where t1.del_time = 0 order by t1.sort asc")
    List<SysOrg> list();
}

